package simulator;

public class Statistics {

		private double dispTime=0;
//		private double totalTime=0;
		private double broken=0;
		private double infected=0;
		
		public void incDispTime(double time){
			this.dispTime+= time;
		}
	
		public double getDispTime() {
			return dispTime;
		}
		
//		public double getTotalTime() {
//			return totalTime;
//		}

		public double getTotalTime() {
		return dispTime + broken + infected;
	}
		
//		public void setTotalTime(double totalTime) {
//			this.totalTime = totalTime;
//		}
		
		public double getBroken() {
			return broken;
		}
		
		public void incBroken(double time) {
			this.broken = broken+time;
		}
		
		public double getInfected() {
			return infected;
		}
		
		public void incInfected(double time) {
			this.infected = infected+time;
		}
		
//		public void incTotalTime(double time) {
//			this.totalTime = this.totalTime+time;
//		}

		public void add(State state) {
			if(state.equals(State.Sane) || state.equals(State.Inmune)){
				this.incDispTime(1);
			} else if(state.equals(State.Infected)){
				this.incInfected(0);
				this.incDispTime(1);
			} else if(state.equals(State.Broken)){
				this.incBroken(1);
			} else if(state.equals(State.Fixing)){
				this.incInfected(1);
			}
//			this.incTotalTime(1);
		}

}
